package helper

import (
	"gin/config"
	"github.com/gin-gonic/gin"
)

func Out(code int, data ...interface{}) gin.H {
	var res interface{}
	if data != nil {
		res = data[0]
	}
	return gin.H{
		"code":   code,
		"reason": config.GetErrorMsg(code),
		"data":   res,
	}
}
